package ch4;

import java.util.Scanner;

public class GetAvg {

	public static void main(String[] args) {
		// 求平均分，共5门课
		Scanner in = new Scanner(System.in);
		double total = 0, avg;
		for (int i = 1; i <= 5; i++) {
			System.out.println("请输入第" + i + "门课的成绩：");
			total += in.nextDouble();
		}
		avg = total / 5;
		// System.out.println("平均分是："+avg);
		System.out.printf("平均分是：%5.2f\n", avg);
	}

}
